package com.dnr.arch.kernel;

import com.dnr.arch.kernel.api.InterfaceToInput;
import com.dnr.arch.kernel.api.InterfaceToLifeCycle;
import com.dnr.arch.kernel.api.InterfaceToLogging;
import com.dnr.arch.kernel.api.InterfaceToOutput;
import com.dnr.arch.kernel.api.InterfaceToPersistence;
import com.dnr.arch.kernel.api.InterfaceToPresentation;
import com.dnr.arch.kernel.api.InterfaceToRules;
import com.dnr.arch.kernel.api.InterfaceToSchedular;
import com.dnr.arch.kernel.api.InterfaceToSecurity;
import com.dnr.arch.kernel.api.KernelInterface;
import com.dnr.arch.kernel.exceptions.KernelInitializationException;
import com.dnr.arch.kernel.services.persistence.JPAPersistenceDriver;
import com.dnr.arch.kernel.services.persistence.PersistenceFactory;

public class KernelFactory {

	private static boolean isInit = true;

	public static void initialize() throws KernelInitializationException {
		
		// Initializing Persistence Factory
		System.out.println("///////Initializing Persistence Factory");
		isInit &= PersistenceFactory.getInstance().initialize();
		
		if(!isInit) throw new KernelInitializationException(0);
	}

	public static InterfaceToPersistence getPersistenceDriver() {
		return PersistenceFactory
				.getPersistenceDriver(KernelConstants.JPA_DRIVER);
	}
	
	public static InterfaceToPresentation getPresentationDriver(){
		return null;
	}
	
	public static InterfaceToLifeCycle getLifeCycleDriver(){
		return null;
	}
	
	public static InterfaceToInput getInputDriver(){
		return null;
	}

	public static InterfaceToOutput getOutputDriver(){
		return null;
	}
	
	public static InterfaceToSecurity getSecurityDriver(){
		return null;
	}
	
	public static InterfaceToSchedular getSchedularDriver(){
		return null;
	}
	
	public static InterfaceToRules getRulesDriver(){
		return null;
	}
	
	public static InterfaceToLogging getLoggingDriver(){
		return null;
	}
}
